﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="CheckOut.aspx.cs" Inherits="CheckOut" ResponseEncoding="utf-8" ContentType="text/html" %>

<%@ Register Assembly="Html5Asp" Namespace="Html5Asp" TagPrefix="cc1" %>
<!DOCTYPE HTML>
<html>  
<head>
<script src="js/Thanh_JS_Checkout.js" type="text/javascript"></script>
</head>
<body>
<form id="formCheckOut" runat="server" style="text-align:center;width:100%" method="post" action="CheckOut.aspx">
   <asp:ScriptManager ID="mainScriptManager" runat="server"></asp:ScriptManager>
   
   <asp:UpdatePanel ID="upGrid" UpdateMode="Conditional" runat="server">
   <ContentTemplate>
       <div id="mesDiv" runat="server" visible="false">
            
       </div>
       <asp:ValidationSummary ID="ValidationSummary1" runat="server" DisplayMode="BulletList" CssClass="ui-corner-all ui-state-error ui-widget" ForeColor="Red"/>
        <table id="mainCheckOutTable" runat=server style="width:100%;position:relative;margin:0px;padding:auto;">

        </table>
        
   </ContentTemplate>
   </asp:UpdatePanel>

   <!-- Các thẻ dùng để show lên (đáng lẽ nên xài cách này, code behind dài quá, moi biet) - 22/3 -->
   
   <div id="loginDiv_1" runat="server" visible="false" style="text-align:center;">
       <table cellpadding="4" class="center">
            <tr>
                <td colspan=2>
                    <h3>Please fill in your email and password</h3>
                </td>
            </tr>
            <tr>
                <th>Email</th>
                <td>
                    <asp:TextBox ID="txtLoginEmail" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator 
                        ID="RequiredFieldValidator1" 
                        runat="server" 
                        ErrorMessage="Email is empty" 
                        ControlToValidate="txtLoginEmail" 
                        Display="None"></asp:RequiredFieldValidator>
                    <br/><asp:RegularExpressionValidator
                        id="regEmail"
                        ControlToValidate="txtLoginEmail"
                        ErrorMessage="Email is invalid"
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                </td>
            </tr>
            <tr>
                <th>Password</th>
                <td>
                    <asp:TextBox ID="txtLoginPass" runat="server" TextMode="Password"/>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Pass word is empty" ControlToValidate="txtLoginPass" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator
                        id="RegularExpressionValidator6"
                        ControlToValidate="txtLoginPass"
                        Text="<br/>Password contain special character"
                        ValidationExpression="^([a-zA-Z0-9]{1,})$"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                </td>
                
            </tr>
			<tr>
                <td colspan=2>
                    <asp:Button ID="butLogin" Text="Login" runat="server" 
                        onclick="butLogin_Click" />
                    <cc1:Reset ID="butReset" runat="server" Text="Reset">
                    </cc1:Reset>
                </td>
            </tr>
       </table>
   </div>

   <!------------------------------------------->

   <div id="billDiv_1" runat="server" visible="false" style="text-align:center;">
       <table cellpadding="4" class="center">
            <tr>
                <td colspan=2>
                    <h3>Please fill this form to complete your order</h3>
                </td>
            </tr>
            <tr>
                <th>Reciver name</th>
                <td>
                    <asp:TextBox ID="txtBillName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server"
                         ErrorMessage="Reciver name is empty" ControlToValidate="txtBillName" Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>Address</th>
                <td>
                    <asp:TextBox ID="txtBillAddress" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server"
                         ErrorMessage="Address is empty" ControlToValidate="txtBillAddress" Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>Phone</th>
                <td>
                    <asp:TextBox ID="txtBillPhone" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server"
                         ErrorMessage="Phone number is empty" ControlToValidate="txtBillPhone" Display="None"></asp:RequiredFieldValidator>
                    <br/><asp:RegularExpressionValidator
                        id="RegularExpressionValidator2"
                        ControlToValidate="txtBillPhone"
                        ErrorMessage="Phone is invalid"
                        ValidationExpression="(?!:\A|\s)(?!(\d{1,6}\s+\D)|((\d{1,2}\s+){2,2}))(((\+\d{1,3})|(\(\+\d{1,3}\)))\s*)?((\d{1,6})|(\(\d{1,6}\)))\/?(([ -.]?)\d{1,5}){1,5}((\s*(#|x|(ext))\.?\s*)\d{1,5})?(?!:(\Z|\w|\b\s))"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                </td>
            </tr>
            <tr>
                <th>Note</th>
                <td>
                    <asp:TextBox ID="txtBillNote" runat="server" Rows="4" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
			<tr>
                <td colspan=2>
                    <asp:Button ID="butSubmitBill" Text="Confrim" runat="server" 
                        onclick="butSubmitBill_Click" />
                    <cc1:Reset ID="Reset1" runat="server" Text="Reset">
                    </cc1:Reset>
                </td>
            </tr>
       </table>
   </div> 

   <!------------------------------------------->

   <div id="registerDiv_1" runat="server" visible="false" style="text-align:center;">
       <table cellpadding="4" class="center">
            <tr>
                <td colspan=2>
                    <h3>Please fill this form to join us :D</h3>
                </td>
            </tr>
            <tr>
                <th>Email</th>
                <td>
                    <asp:TextBox ID="txtReEmail" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server"
                         ErrorMessage="Email is empty" ControlToValidate="txtReEmail" Display="None"></asp:RequiredFieldValidator>
                    <br/><asp:RegularExpressionValidator
                        id="RegularExpressionValidator1"
                        ControlToValidate="txtReEmail"
                        ErrorMessage="Email is invalid"
                        ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                </td>
            </tr>
            <tr>
                <th>Password</th>
                <td>
                    <asp:TextBox ID="txtRePass" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server"
                        ErrorMessage="Password is empty" ControlToValidate="txtRePass" Display="None"></asp:RequiredFieldValidator>
                    <br/><asp:RegularExpressionValidator
                        id="RegularExpressionValidator4"
                        ControlToValidate="txtRePass"
                        ErrorMessage="Password is too short/long"
                        ValidationExpression="^([^~]{8,30})$"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                    <asp:RegularExpressionValidator
                        id="RegularExpressionValidator5"
                        ControlToValidate="txtRePass"
                        Text="<br/>Password contain special character"
                        ValidationExpression="^([a-zA-Z0-9]{1,})$"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                </td>
                
            </tr>           
            <tr>
                <th>Re-type password</th>
                <td>
                    <asp:TextBox ID="txtReRePass" runat="server" TextMode="Password"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server"
                         ErrorMessage="Re-type password is empty" ControlToValidate="txtReRePass" Display="None"></asp:RequiredFieldValidator>
                    <br/><asp:CompareValidator ID="CompareValidator1" runat="server"
                        ErrorMessage="Re-type password is not the same" 
                        ControlToValidate="txtReRePass"
                        ControlToCompare="txtRePass" 
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"></asp:CompareValidator>
                </td>
            </tr>
            <tr>
                <th>Full name</th>
                <td>
                    <asp:TextBox ID="txtReName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator11" runat="server"
                         ErrorMessage="Full name is empty" ControlToValidate="txtReName" Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>Address</th>
                <td>
                    <asp:TextBox ID="txtReAddress" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server"
                         ErrorMessage="Address is empty" ControlToValidate="txtReAddress" Display="None"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <th>Phone</th>
                <td>
                    <asp:TextBox ID="txtRePhone" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator10" runat="server"
                         ErrorMessage="Phone number is empty" ControlToValidate="txtRePhone" Display="None"></asp:RequiredFieldValidator>
                    <br/><asp:RegularExpressionValidator
                        id="RegularExpressionValidator3"
                        ControlToValidate="txtRePhone"
                        ErrorMessage="Phone is invalid"
                        ValidationExpression="(?!:\A|\s)(?!(\d{1,6}\s+\D)|((\d{1,2}\s+){2,2}))(((\+\d{1,3})|(\(\+\d{1,3}\)))\s*)?((\d{1,6})|(\(\d{1,6}\)))\/?(([ -.]?)\d{1,5}){1,5}((\s*(#|x|(ext))\.?\s*)\d{1,5})?(?!:(\Z|\w|\b\s))"
                        Runat="server"
                        Display="Dynamic"
                        CssClass="ui-corner-all ui-state-error ui-widget"/>
                </td>
            </tr>
			<tr>
                <td colspan=2>
                    <asp:Button ID="butReSubmit" Text="Confrim" runat="server"
                        onclick="butReSubmit_Click" />
                    <cc1:Reset ID="Reset2" runat="server" Text="Reset">
                    </cc1:Reset>
                </td>
            </tr>
       </table>
   </div> 

   <!----------------------------------------->
    <div id="newUserDiv_1" runat="server" visible="false" style="text-align:center;">
       <table cellpadding="4" class="center">
			<tr>
                <td colspan="2"><h2>Hello there, care to join us?</h2></td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="butNewUserResg" Text="OK, count me in." runat="server" 
                        onclick="butNewUserResg_Click" />
                </td>
                <td>
                    <asp:Button ID="butNewUserMoveon" Text="No thanks, move on." runat="server" 
                        onclick="butNewUserMoveon_Click" />
                </td>
            </tr>
       </table>
   </div>

   <!----------------------------------------->
    <div id="confrimDiv_1" runat="server" visible="false" style="text-align:center;">
       <h2>This will be your bill</h2>
       <table id="confrimDiv_Table" cellpadding="4" class="center"  visible="false">
            <tr>
                <td>
                    <div id="billingInfo" runat="server">
            
                    </div>   
                </td>    
            </tr>
            <tr>
                <td>
                    <table id="lastTable" runat="server">

                    </table>                    
                </td>    
            </tr>
       </table>
       <asp:Button ID="butLastCofrim" Text="Confrim" runat="server" 
                        onclick="butLastCofrim_Click" OnClientClick="lastButtonClick();"/>
   </div>

</form>
</body>
</html>